<?php
/**
 * Created by PhpStorm.
 * User: creatint
 * Date: 2016/7/19
 * Time: 13:58
 */

namespace Admin\Model;
use Think\Model;
use Admin\Tool\WechatException;

class WechatModel extends Model{
    /* 自动验证规则 */
    protected $_validate = array(
    );

    /* 自动完成规则 */
    protected $_auto = array(
    );

    public function get_wechat($api){
            $data = $this->where("`api`='{$api}'")->find();
            if(is_array($data)){
                return $data;
            }else{
                throw new WechatException('获取公众号信息失败', 500001);
            }
    }
}